import { shallowRef } from 'vue'
import { defineStore } from 'pinia'
import { fetchDateType } from '@/services/global'

export const useGlobalStore = defineStore('global', () => {
  const dateTypes = shallowRef([])

  async function initDateTypes() {
    const data = (await fetchDateType()) as any
    dateTypes.value = data || []
  }

  return {
    dateTypes,
    initDateTypes,
  }
})
